package old;

import java.util.ArrayList;
import commands.BasicAction;

public class Parser {
    String userInput;
    BasicAction newAction = null;
    static ArrayList<String> output = new ArrayList<String>();
    
    
    public Parser(String ainput){
        userInput = ainput;
        //newAction = new BasicAction(userInput,output);
    }
    
    public void parseCmd(String action){
        if(action.compareTo("add") == 0) newAction.add(userInput);
        if(action.compareTo("remove") == 0) newAction.remove(userInput);
    }
    
    
    //pass Object with statements to be displayed to GUI
    public static ArrayList<String> out(){
    	return output;
    	
    }
    
    //print to console instead
    public static void out2console(){
    	int size = output.size();
        
		 for(int i = 0; i < size ; i++){
			 //System.out.println(size);
			 String astr = output.get(i);
			 System.out.println(astr);
		 }
		 output.clear();
    }
    
}
